import request from '@/utils/request'

// 查询功能/特性库列表
export function listFunction(query) {
  return request({
    url: '/fmea/mfmea/function/list',
    method: 'get',
    params: query
  })
}

// 查询功能/特性库详细
export function getFunction(id) {
  return request({
    url: '/fmea/mfmea/function/' + id,
    method: 'get'
  })
}

// 新增功能/特性库
export function addFunction(data) {
  return request({
    url: '/fmea/mfmea/function',
    method: 'post',
    data: data
  })
}

// 修改功能/特性库
export function updateFunction(data) {
  return request({
    url: '/fmea/mfmea/function',
    method: 'put',
    data: data
  })
}

// 删除功能/特性库
export function delFunction(id) {
  return request({
    url: '/fmea/mfmea/function/' + id,
    method: 'delete'
  })
}

// 导出功能/特性库
export function exportFunction(query) {
  return request({
    url: '/fmea/mfmea/function/export',
    method: 'get',
    params: query
  })
}

// 修改版本状态
export function modifyVStatus(query) {
  return request({
    url: '/fmea/mfmea/function/updateVersionStatus',
    method: 'get',
    params: query
  })
}
// 校验功能库
export function exactFunctionKnow(query) {
  return request({
    url: '/fmea/mfmea/function/exactQuery',
    method: 'get',
    params: query
  })
}

// 下载模板
export function downLoadTemplate(query) {
  return request({
    url: '/fmea/mfmea/function/downloadImportFunctionTemplate',
    method: 'get',
    params: query
  })
}
